Skip to content

feat(examples): jobs custom-form / legacy-iframe fixture + 1.10.0 (#659)#671

Merged
MartinCastroAlvarez merged 1 commit into
mainfrom
feat/examples-jobs-custom-form
Jun 1, 2026
Merged

feat(examples): jobs custom-form / legacy-iframe fixture + 1.10.0 (#659)#671
MartinCastroAlvarez merged 1 commit into
mainfrom
feat/examples-jobs-custom-form

Conversation

@MartinCastroAlvarez
Copy link
Copy Markdown
Owner

Summary

Adds examples/jobs — the cross-repo custom-form fixture that proves the legacy-iframe escape hatch end-to-end. A single Job model whose ModelAdmin exercises the request-driven custom-view + custom-template pattern using only documented Django hooks (formfield_for_dbfield, an admin action, a change_view branch, a hand-rolled dual-listbox template) — no SPA-specific API anywhere. The whole point: if this runs on /admin-react/, any legacy /admin/ ModelAdmin does too.

Two rendering paths

  • Path A/admin-react/jobs/job/<pk>/change/: the stock form-spec; formfield_for_dbfield surfaces the large-textarea metadata widget (vLargeTextField), rendered natively by the SPA.
  • Path B?run_custom=1: change_view renders a custom dual-listbox template. The form-spec resolver returns {renderer: "legacy-iframe", legacy_url: …} (rest-api 1.5.0), and the SPA's LegacyIframe (Detail-page form parity: honour ModelAdmin form / fieldsets / formfield_overrides / get_form (via rest-api form-spec) #659) embeds the legacy page in an iframe inside its own chrome. The ordered POST contract (getlist("selected_steps")) is preserved.

What changed

Validation

  • Root suite 66 passed; jobs example 5 passed; verified end-to-end against the published rest-api 1.5.0 + mcp 1.3.0.

Completes the cross-repo trio: rest-api #59 (released 1.5.0) → mcp #70 (released 1.3.0) → react #659.

🤖 Generated with Claude Code

…+ 1.10.0

Adds examples/jobs — a Job ModelAdmin that exercises the request-driven
custom-view + custom-template pattern using only documented Django hooks
(formfield_for_dbfield, an admin action, a change_view branch, a hand-rolled
dual-listbox template). Path A renders the stock form-spec with the
large-textarea metadata widget; Path B (?run_custom=1) returns
renderer: legacy-iframe and the SPA embeds the legacy page in an iframe.
Backend tests cover both paths and the ordered POST contract (#659).

Raises dependency floors for the cross-repo contract: django-admin-rest-api
^1.5.0 (broadened legacy-iframe detection for request-driven custom views,
#59) and django-admin-mcp-api >=1.3.0 (matching MCP release, #70).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@MartinCastroAlvarez MartinCastroAlvarez merged commit 45dd07d into main Jun 1, 2026
6 checks passed
@MartinCastroAlvarez MartinCastroAlvarez deleted the feat/examples-jobs-custom-form branch June 1, 2026 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants